<template>
  <div class="container">
    <div class="flex flex-wrap f-ptp10">
      <el-select class='f-mrt20 f-mbt10 f-w120' v-model="vip" clearable placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value">
        </el-option>
      </el-select>
      <el-input class='f-mrt20 f-mbt10 f-w120' v-model="phone" placeholder="手机号"></el-input>
      <el-select class='f-mrt20 f-mbt10 f-w120' v-model="vip" clearable placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value">
        </el-option>
      </el-select>
      <el-input class='f-mrt20 f-mbt10 f-w120' v-model="createTime" placeholder="注册时间开始-结束"></el-input>
      <el-button class='f-h40' @click="search" type="primary">查询</el-button>
    </div>
    <div>
      <el-table
        :data="tableData"
        border
        style="width: 100%">
        <el-table-column prop="issueType" label="问题类型" width="180"></el-table-column>
        <el-table-column prop="phone" label="手机号" width="120"></el-table-column>
        <el-table-column prop="region" label="地区" width="180"></el-table-column>
        <el-table-column prop="content" label="问题详情" width="120">
          <template slot-scope="scope">
            <span @click="showBtnClick(scope.$index, scope.row)" class='s-c-green f-csp'>查看</span>
          </template>
        </el-table-column>
        <el-table-column prop="createTime" label="提交时间" width="180"></el-table-column>
        <el-table-column prop="manage" label="管理">
          <template slot-scope="scope">
            <span @click="handleClickEvent(scope.$index, scope.row)" class='s-c-green f-csp'>处理</span>
          </template>
        </el-table-column>
      </el-table>
      <div>
        <!-- <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page.sync="currentPage1"
          :page-size="100"
          layout="total, prev, pager, next"
          :total="1000">
        </el-pagination> -->
      </div>
    </div>

    <el-dialog
      title="问题详情"
      :visible.sync="showDetial"
      center
      width="560px">
      <span>这是一段信息</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showDetial = false">取 消</el-button>
        <el-button type="primary" @click="showDetial = false">确 定</el-button>
      </span>
    </el-dialog>

  </div>
</template>

<script>
export default {
  name: 'IssueManage',
  data() {
    return {
      phone: '',
      password: '',
      createTime: null,
      showDetial: false,
      vip: null,
      options: [{
        value: '选项1',
        label: '黄金糕'
      }, {
        value: '选项2',
        label: '双皮奶'
      }, {
        value: '选项3',
        label: '蚵仔煎'
      }, {
        value: '选项4',
        label: '龙须面'
      }, {
        value: '选项5',
        label: '北京烤鸭'
      }],
      value: '',
      tableData: [
        {
          userCode: '2016-05-02',
          phone: '18098758888',
          name: '王小虎',
          idCard: '330326199908080606',
          accountBalance: 5000.00,
          vip: 1,
          createTime: '2018-12-30'
        }, {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄'
        }, {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄'
        }, {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1516 弄'
        }
      ]
    }
  },
  methods: {
    showBtnClick(index, row) {
      console.log('index::', index);
      console.log('row:::', row);
      this.showDetial = true;
    },
    handleClickEvent(index, row) {
      console.log('index::', index);
      console.log('row:::', row);
      this.$confirm('是否对当前问题已进行处理？', '处理', {
        confirmButtonText: '已处理',
        cancelButtonText: '未处理',
        type: 'warning'
      }).then(res => {
        console.log('res:::', res);
      }).catch(err => {
        console.error('err:::', err);
      })
    },
    search() {
      
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
